import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [{
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () =>
                import ( /* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '主页' },
            children: [{
                    path: '/dashboard',
                    component: () =>
                        import ( /* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/upload_drawing',
                    component: () =>
                        import ( /* webpackChunkName: "form" */ '../components/page/uploadDrawing.vue'),
                    meta: { title: '上传图纸', roles: ['designer'] }
                },
                {
                    path: '/import_drawing',
                    component: () =>
                        import ( /* webpackChunkName: "table" */ '../components/page/importDrawing.vue'),
                    meta: { title: '导入图纸', roles: ['designer'] }
                },
                // {
                //     path: '/download_drawing',
                //     component: () => import(/* webpackChunkName: "table" */ '../components/page/downloadDrawing.vue'),
                //     meta: { title: '图模下载', roles: ['builder', 'watcher', 'boss'] }
                // },
                {
                    path: '/drawing_examine',
                    component: () =>
                        import ( /* webpackChunkName: "table" */ '../components/page/drawingExamine.vue'),
                    meta: { title: '图纸审查', roles: ['builder', 'watcher', 'boss'] }
                },
                // {
                //     path: '/model_examine',
                //     component: () => import(/* webpackChunkName: "table" */ '../components/page/modelExamine.vue'),
                //     meta: { title: '模型审查', roles: ['builder', 'watcher', 'boss'] }
                // },
                {
                    path: '/model_notation',
                    component: () =>
                        import ( /* webpackChunkName: "table" */ '../components/page/modelNotation.vue'),
                    meta: { title: '模型批注', roles: ['builder', 'watcher', 'boss'] }
                },
                {
                    path: '/other_function',
                    component: () =>
                        import ( /* webpackChunkName: "table" */ '../components/page/otherFunction.vue'),
                    meta: { title: '其他功能', roles: ['builder', 'watcher', 'boss'] }
                },
                {
                    path: '/answer_questions',
                    component: () =>
                        import ( /* webpackChunkName: "editor" */ '../components/page/answerQuestions.vue'),
                    meta: { title: '答疑', roles: ['designer'] }
                },
                {
                    path: '/examine_conclusion',
                    component: () =>
                        import ( /* webpackChunkName: "markdown" */ '../components/page/examineConclusion.vue'),
                    meta: { title: '会审结论', roles: ['watcher'] }
                },
                {
                    path: '/result_set',
                    component: () =>
                        import ( /* webpackChunkName: "markdown" */ '../components/page/resultSet.vue'),
                    meta: { title: '会审记录表', roles: ['watcher'] }
                },
                {
                    path: '/upload_signature',
                    component: () =>
                        import ( /* webpackChunkName: "upload" */ '../components/page/uploadSignature.vue'),
                    meta: { title: '上传签名', roles: ['builder', 'watcher', 'boss'] }
                },
                {
                    path: '/drawing_upload',
                    component: () =>
                        import ( /* webpackChunkName: "drag" */ '../components/page/drawingUpload.vue'),
                    meta: { title: '图模上传', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/drawing_import',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/page/drawingImport.vue'),
                    meta: { title: '图模导入', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/drawing_compare',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/page/drawingCompare.vue'),
                    meta: { title: '图纸对比', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/model_compare',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/page/modelCompare.vue'),
                    meta: { title: '模型对比', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                // {
                //     path: '/change_apply',
                //     component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/changeApply.vue'),
                //     meta: { title: '变更申请', roles: ['designer', 'builder', 'watcher', 'boss'] }
                // },
                {
                    path: '/new_application_form',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/newApplicationForm.vue'),
                    meta: { title: '新建工程设计变更申请单', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/watcher_examine',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/watcherExamine.vue'),
                    meta: { title: '监理审批', roles: ['watcher'] }
                },
                {
                    path: '/boss_examine',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/bossExamine.vue'),
                    meta: { title: '业主审批', roles: ['boss'] }
                },
                {
                    path: '/designer_examine',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/designerExamine.vue'),
                    meta: { title: '设计方审批', roles: ['designer'] }
                },
                {
                    path: '/work_order',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/workOrder.vue'),
                    meta: { title: '编制工程设计变更通知单', roles: ['watcher'] }
                },
                {
                    path: '/check_notification',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/checkNotification.vue'),
                    meta: { title: '查看通知', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/cost_estimation',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/costEstimation.vue'),
                    meta: { title: '成本估算', roles: ['boss'] }
                },
                {
                    path: '/prepare_change_sheet',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/prepareChangeSheet.vue'),
                    meta: { title: '编制工程变更单', roles: ['boss'] }
                },
                {
                    path: '/check_change_sheet',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/checkChangeSheet.vue'),
                    meta: { title: '查收工程变更单', roles: ['builder'] }
                },
                {
                    path: '/prepare_instruction_sheet',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/prepareInstructionSheet.vue'),
                    meta: { title: '编制工程变更指令确认单', roles: ['builder'] }
                },
                {
                    path: '/prepare_settlement',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/prepareSettlement.vue'),
                    meta: { title: '编制工程变更签证结算书说明', roles: ['builder'] }
                },
                {
                    path: '/money_cal',
                    component: () =>
                        import ( /* webpackChunkName: "dragdialog" */ '../components/project_change/moneyCal.vue'),
                    meta: { title: '成本核算结果', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/info',
                    component: () =>
                        import ( /* webpackChunkName: "tabs" */ '../components/page/Info.vue'),
                    meta: { title: '消息中心', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/404',
                    component: () =>
                        import ( /* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/403',
                    component: () =>
                        import ( /* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403', roles: ['designer', 'builder', 'watcher', 'boss'] }
                },
                {
                    path: '/no_permission',
                    component: () =>
                        import ( /* webpackChunkName: "login" */ '../components/page/noPermission.vue'),
                    meta: { title: '暂无权限', roles: ['designer', 'builder', 'watcher', 'boss'] }
                }
            ]
        },
        {
            path: '/login',
            component: () =>
                import ( /* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录', roles: ['designer', 'builder', 'watcher', 'boss'] }
        },
        {
            path: '/register',
            component: () =>
                import ( /* webpackChunkName: "login" */ '../components/page/Register.vue'),
            meta: { title: '注册', roles: ['designer', 'builder', 'watcher', 'boss'] }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});